import request from "@/utils/request";

// 查询参数列表
export function listConfig(query) {
  return request({
    url: "/admin/system/config/list",
    method: "get",
    params: query,
  });
}

// 查询参数详细
export function getConfig(configId) {
  return request({
    url: "/admin/system/config/detail/" + configId,
    method: "get",
  });
}

// 新增参数配置
export function addConfig(data) {
  return request({
    url: "/admin/system/config/add",
    method: "post",
    data: data,
  });
}

// 修改参数配置
export function updateConfig(data) {
  return request({
    url: "/admin/system/config/update",
    method: "post",
    data: data,
  });
}

// 删除参数配置
export function delConfig(configId) {
  return request({
    url: "/admin/system/config/del/" + configId,
    method: "get",
  });
}

// 导出参数
export function exportConfig() {
  return "/export/admin/system/config/export";
}

// 查询参数详细
export function getConfigByKey(configKey) {
  return request({
    url: "/admin/system/config/base/detail/" + configKey,
    method: "get",
  });
}
export function getConfigByKeys(configKey) {
  return request({
    url: "/admin/system/config/base/detail/multiple/" + configKey,
    method: "get",
  });
}

// 获取obs秘钥
export function selectObsByKeys(data) {
  return request({
    url: "/admin/system/config/base/selectObsByKeys",
    method: "post",
    data: data,
  });
}

// 刷新字典缓存
export function refreshCache(configIds) {
  return request({
    url: "/admin/system/config/refreshCache/" + configIds,
    method: "post",
  });
}
